//
//  KKCalendarView.h
//  SHDoctor
//
//  Created by Mac mini on 15/10/13.
//  Copyright © 2015年 ShiHeng. All rights reserved.
//

#import <UIKit/UIKit.h>

#import "UIColor+Custom.h"

@class KKCalendarViewCell;

@protocol KKCalendarViewDelegate;

typedef void(^KKCalendarViewUpdateHeightHandle)(CGFloat updateHeight);

@interface KKCalendarView : UIView

@property (nonatomic, copy, nullable) NSDate *selectedDate;     /**< 当前时间 默认为今天 */

@property (nonatomic, copy, nullable) KKCalendarViewUpdateHeightHandle updateHeightHandle;

@property (nonatomic, weak) id<KKCalendarViewDelegate> delegate;

@property (nonatomic, copy, nullable) NSString *dateFormatter;  /**< 设置时间转换类型 默认yyyyMMdd */

//  注册日期的item Class [默认是KKCalendarViewCell]
- (void)registerDayViewClass:(nullable Class)cellClass;

//  刷新数据
- (void)reloadData;

@end



@protocol KKCalendarViewDelegate <NSObject>

@optional

- (void)calendarView:(nullable KKCalendarView *)calendarView redrawCell:(nullable KKCalendarViewCell*)cell;

- (void)calendarView:(nullable KKCalendarView *)calendarView didSelectedCell:(nullable KKCalendarViewCell*)cell;

@end


@interface KKCalendarViewCell : UIButton {
    
    UILabel* _titleLabel;
}

@property (nonatomic, readonly, nullable) UIImageView *pointView;
@property (nonatomic, readonly, nullable) NSDate *date;         /**< 时间Date */
@property (nonatomic, readonly, nullable) NSString *dateString; /**< 时间String 默认yyyyMMdd */

@property (nonatomic) BOOL isToday;

@property (nonatomic) BOOL hasTask;

@end

